import axios from 'axios'
import NProgress from 'nprogress'

axios.defaults.baseURL = 'http://106.53.73.30:8888/api/private/v1/'
axios.interceptors.response.use(res=>{
    NProgress.done()
    
    return res.data
})
axios.interceptors.request.use(config=>{
    NProgress.start()
    let token = sessionStorage.getItem('token')
   if(token){
    config.headers.Authorization = token 
   }
    return config
})
export default axios
